﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Newtonsoft.Json;
using AiXiu.BLL;
using AiXiu.IBLL;
using AiXiu.Model;

namespace AiXiu.WebSite.Handler
{
    /// <summary>
    /// VideoLike 的摘要说明
    /// </summary>
    public class VideoLike : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            string videoId = context.Request["videoId"];
            int userId = Convert.ToInt32(context.Request["userId"]);
            ILikeBLL likeBLL = new LikeBLL(videoId);

            OperResult<bool> res = likeBLL.AddOrRemoveLike(userId);
            context.Response.Write(JsonConvert.SerializeObject(res));
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}